import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import shopcart from './modules/shopcart'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        id: 0,
        username: ''
    },
    mutations: {
        addUser(state, user) {
            state.id = user.id
            state.username = user.username
        },
        delUser(state) {
            state.id = 0
            state.username = ''
        }
    },
    actions: {},
    modules: {
		user,
		shopcart
	}
})